
<template>
  <div>center</div>
</template>

<script  >
//setup 中没有这个函数钩子
export default {
  async beforeRouteEnter(fo, from, next) {
    let [isAuthenticated] = await Promise.all([localStorage.getItem("token")])
    if (isAuthenticated){
      next()
    }else {
      next({name:"login"})
    }
  }
}
</script>